<script type="text/javascript">

function getPreviewIt() {
    $j(document).ready(function(){
        titolo = $j("#vanilla_announce_it_title").val();
        testo = $j("#vanilla_announce_it_text_ifr").contents().find('#tinymce').html();

        window.open("<?php echo url_for('@announce_preview', true) ?>?titolo="+titolo+"&testo="+testo);
    });
}

function getPreviewEn() {
    $j(document).ready(function(){
        titolo = $j("#vanilla_announce_en_title").val();
        testo = $j("#vanilla_announce_en_text_ifr").contents().find('#tinymce').html();

        window.open("<?php echo url_for('@announce_preview', true) ?>?titolo="+titolo+"&testo="+testo);
    });
}
</script>
<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<div class="sf_admin_form">
  <?php echo form_tag_for($form, '@vanilla_announce', array('class' => 'backend')) ?>
    <?php echo $form->renderHiddenFields() ?>

    <?php if ($form->hasGlobalErrors()): ?>
      <?php echo $form->renderGlobalErrors() ?>
    <?php endif; ?>

    <?php foreach ($configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit') as $fieldset => $fields): ?>
      <?php include_partial('announce/form_fieldset', array('vanilla_announce' => $vanilla_announce, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?>
    <?php endforeach; ?>

    <?php include_partial('announce/form_actions', array('vanilla_announce' => $vanilla_announce, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>
  </form>
</div>
